package online.heycm.platform.rocketmq.publisher;

import online.heycm.platform.rocketmq.common.entity.Event;
import org.apache.rocketmq.client.producer.SendCallback;

/**
 * 事件推送器
 *
 * @author heycm
 * @since 2023/12/2 20:24
 */
public interface EventPublisher {

    /**
     * 发送事务消息
     *
     * @param event
     * @return
     */
    boolean pushTransaction(Event event);

    /**
     * 发送广播消息
     *
     * @param event
     * @return
     */
    boolean pushBroadcast(Event event);

    /**
     * 发送延时消息
     */
    boolean pushDelay(Event event);

    /**
     * 同步发送
     *
     * @param event
     * @return
     */
    boolean pushSync(Event event);

    /**
     * 异步发送
     *
     * @param event
     * @return
     */
    void pushAsync(Event event, SendCallback sendCallback);

    /**
     * 发送顺序消息
     *
     * @param event
     * @return
     */
    boolean pushOrderly(Event event);
}
